#ifndef VERSION2PROTOCOL_H
#define VERSION2PROTOCOL_H

#include <QObject>
#include "Protocol/BaseProtocol.h"
#include "DataType/PortStruct.h"
#include "System/CheckCode.h"



class Version2Protocol : public BaseProtocol
{
    Q_OBJECT
public:
    explicit Version2Protocol(QObject *parent = 0);
    QList<Package> parseData(QByteArray data);
    QByteArray generateData(Package package);

    enum FunctionCode
    {
        Synchrosystem=0x0008,
        NotifyReboot=0x001e,
        ControlVigverse=0x0030,
    };


private:

    enum CheckSteps
    {
        CHECK_HEAD,
        CHECK_VERSION,
        CHECK_ID,
        CHECK_FUNCTION,
        CHECK_LENGTH,
        CHECK_BODY,
        CHECK_CHECKCODE,
        CHECK_CHECKLENGTH,
    };

};

#endif // VERSION2PROTOCOL_H
